-
Notifications
You must be signed in to change notification settings - Fork 92
Exception in JUnit test after disabling JVM forking #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5b5a38e
to
1b91ef7
Compare
@@ -250,7 +250,6 @@ private[scala] trait MarkupParserCommon extends TokenTests { | |||
else if (ch == SU || eof) | |||
truncatedError("") // throws TruncatedXMLControl in compiler | |||
|
|||
sb append ch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the line in scala-xml that in turn causes the OOM exception to be thrown by java.util.Arrays
by way of java.lang.StringBuilder
. Even after removing the line in question from scala-xml, see above, it still causes the test suite to run out of memory. Which scala-xml is it running that causes the memory overflow? It doesn't seem to be the code under test.
Removing the line that emits the exception, still causes the exception. This can be verified from the Travis build:
|
this is kind of a wild guess, but XMLEventReader uses a background thread. perhaps that thread needs to be explicitly shut down? |
Thanks for pointing that out. That's curious. I hadn't noticed it. I'll try calling |
Unfortunately, no joy after adding |
You cannot disable JVM test forking when working on a scala module that is distributed with the compiler (which is the case for scala-xml and scala-parser-combinators) because of an SBT classloader leaking issue (#20). Basically, when not forking, the test are compiled against the locally built classes, but they are run against the ones bundled with the compiler (the ones from the bootclasspath, or from the special |
@gourlaysama Thanks for this. I was losing my mind understanding what was amiss. I had seen @jsuereth branch, |
I've reworked this PR to add an explicit setting of |
f11f8a8
to
887fbe1
Compare
Add a comment with a description of the issue by Antoine Gourlay and refer to the relevant GitHub issues.
887fbe1
to
150a237
Compare
LGTM |
final review/merge by @biswanaths ? |
@SethTisue words are final though. Thank you @SethTisue for review and @ashawley for the PR. |
* build.sbt (fork): SBT was leaking scala-xml from scala-compiler because of an incorrect library dependency exclude rule.
* build.sbt (fork): SBT was leaking scala-xml from scala-compiler because of an incorrect library dependency exclude rule.
* build.sbt (fork): SBT was leaking scala-xml from scala-compiler because of an incorrect library dependency exclude rule.
* build.sbt (fork): SBT was leaking scala-xml from scala-compiler because of an incorrect library dependency exclude rule.
Disabling JVM forking while working on #110 causes a JUnit test to fail.
This unit test hasn't been an issue in the past, but was found while trying to troubleshoot a different Travis build error after adding a Scalacheck test suite to scala-xml. It's not clear if this is the actual issue that adding Scalacheck introduce. Very likely, it could just be a false lead after desperately trying to understand the original problem.